package edu.nf.exam.dao.impl;

import edu.nf.exam.dao.QuestionContentInfoDao;
import edu.nf.exam.entity.QuestionContentInfo;
import edu.nf.exam.util.MyBatisUtil;
import org.apache.ibatis.session.SqlSession;

/**
 * @Author : QYM
 * @create 2021/6/17
 * 题目内容信息表（单选题，多选题，判断题）--接口实现类
 */
public class QuestionContentInfoDaoImpl implements QuestionContentInfoDao {
    /**
     * 添加
     * @param questionContentInfo
     * @return
     */
    @Override
    public int add(QuestionContentInfo questionContentInfo) {
        SqlSession sqlSession = MyBatisUtil.getSqlSession(true);
        int r = sqlSession.getMapper(QuestionContentInfoDao.class).add(questionContentInfo);
        sqlSession.close();
        return r;
    }

    /**
     * 修改
     * @param questionContentInfo
     * @return
     */
    @Override
    public int update(QuestionContentInfo questionContentInfo) {
        SqlSession sqlSession = MyBatisUtil.getSqlSession(true);
        int r = sqlSession.getMapper(QuestionContentInfoDao.class).update(questionContentInfo);
        sqlSession.close();
        return r;
    }
}
